/**
 * File: e:\OwnProject\unicodeHelper\webpack.config.js
 * Project: e:\OwnProject\unicodeHelper
 * Created Date: Thursday, April 15th 2021, 3:45:29 pm
 * Author: chenfayun<731362307@qq.com>
 * -----
 * Last Modified: Fri Apr 16 2021
 * Modified By: chenfayun
 * -----
 * Copyright (c) 2021 Your Company
 * ------------------------------------
 */
const TerserPlugin = require("terser-webpack-plugin");
const path = require("path");

module.exports = {
  mode: "production",
  entry: ["./src/index.ts"],
  output: {
    filename: "index.js",
    path: path.resolve(__dirname, "lib"),
  },
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src"),
    },
    extensions: ["*", ".ts", ".tsx", ".js", ".jsx", ".json"],
  },
  module: {
    rules: [
      {
        test: /\.(tsx|ts)?$/,
        loader: "awesome-typescript-loader",
        exclude: /node_modules|test/,
        options: {
          useBabel: true,
          babelCore: "@babel/core",
        },
      },
    ],
  },
  optimization: {
    minimize: true,
    minimizer: [new TerserPlugin()],
  },
};
